SATA primitive prediction and correction

ABSTRACT

A method of correcting corrupted primitives transmitted between a serial advanced technology attachment (SATA) host and a SATA device includes detecting the presence of a corrupted primitive; analyzing a current state, a previously transmitted primitive, or a previously received primitive; selecting at least one candidate primitive according to at least one of the current state, the previously transmitted primitive, and the previously received primitive; predicting the identity of the corrupted primitive according to at least one candidate primitive and the corrupted primitive; and replacing the corrupted primitive with the predicted primitive.

CROSS REFERENCE TO RELATED APPLICATIONS

This application claims the benefit of the filing date of U.S.provisional patent application No. 60/766,771, filed Feb. 10, 2006, thecontents of which are hereby incorporated by reference.

BACKGROUND

The invention relates to serial advanced technology attachment (SATA)devices, and more particularly, to a method of correcting primitivesthat have become corrupted due to noise.

In the SATA protocol, the host and the device exchange informationthrough Frame Information Structures (FIS). Each FIS is composed of agroup of Dwords, and the Dwords convey information between the host andthe device. The SATA host and SATA device utilize primitives for controlpurposes and to provide a status of the serial line. Each primitive isalso made up of one Dword. Primitives are also used to performhandshaking between a host and a device.

Please refer to FIG. 1 . FIG. 1 is a table 10 illustrating byte contentsof primitives used in the SATA protocol. Each primitive contains fourbytes, and the contents of the first, second, third, and fourth bytesare shown in columns 12, 14, 16, and 18, respectively.

Please refer to FIG. 2. FIG. 2 is a diagram showing an example ofsending a frame between a host and a device. The host can either be atransmitter 100 or a receiver 200, with the receiver being the other. InFIG. 2, the transmitter 100 transmits a series of data or primitives102-188 to the receiver 200, and the receiver 200 responds withprimitives 202-288 to be sent to the transmitter 100.

In FIG. 2, the transmitter 100 starts off by transmitting syncprimitives followed by scrambled data packets 102, 104 to the receiver200. The symbol “XXXX” represents the scrambled data values, and thesedata packets 102, 104 are not primitives. The scrambled data is used toreduce the effects of electromagnetic interference (EMI). When thetransmitter 100 is ready to begin transmitting a frame to the receiver200, the transmitter 100 outputs a transmission data ready (X_RDY)primitive indicating that the transmitter 100 is ready to transmitpayload to the receiver 200. In this example, the transmitter 100 sendstwo X_RDY primitives 106, 108, issues a continue repeating previousprimitive (CONT) primitive 110 to avoid having to output the sameprimitive repeatedly, and then outputs a series of scrambled datapackets 112-118. The transmitter 100 continues this until the receiver200 responds to the X_RDY primitives with a receiver ready (R_RDY)primitive, indicating that the receiver 200 is ready to receive thepayload. In this example, the receiver 200 sends two R_RDY primitives214, 216, issues a CONT primitive 218, and then outputs a series ofscrambled data packets 220-224 until the transmitter 100 startstransmitting the frame.

The transmitter 100 sends a start of frame (SOF) primitive 120 to thereceiver 200 to indicate that the frame is starting to be transmitted.Next, the transmitter 100 sends a type indicator 122 to specify the typeof FIS that is being sent to the receiver 200, followed by a pluralityof data packets 124-130. While the receiver 200 is receiving data fromthe transmitter 100, the receiver 200 outputs reception in progress(R_IP) primitives 226, 228 to the transmitter 100 followed by a CONTprimitive 230 and scrambled data 232-238. When the transmitter 100temporarily does not have any payload data ready for transmission, ahold data transmission (HOLD) primitive is output. As shown in FIG. 2,the transmitter 100 outputs HOLD primitives 132, 134 followed by a CONTprimitive 136, scrambled data 138-142, and followed by another HOLDprimitive 144. The receiver 200 acknowledges these HOLD primitives withhold acknowledge (HOLDA) primitives 240, 242 followed by a CONTprimitive 244 and scrambled data 246-252.

The transmitter 100 then finishes sending the payload data with datapackets 146-150, followed by cyclic redundancy check (CRC) data 152 andan end of frame (EOF) primitive 154. Next, the transmitter 100continuously outputs wait for frame termination (WTRM) primitives156-158, a CONT primitive 162, and scrambled data 164-170 while waitingfor an indication of reception status from the receiver 200. Thereceiver 200, meanwhile, finishes receiving the payload data from thetransmitter 100 and outputs R_IP primitives 254, 256 followed by a CONTprimitive 258 and scrambled data 260, 262. After the receiver 200 hasreceived all payload data, the CRC 152, the EOF 154, and verified thatthe CRC check has no problems, the receiver 200 then outputs receptionwith no error (R_OK) primitives 264, 266 followed by a CONT primitive268 and scrambled data 270-278. If the CRC check did have problems, thenthe receiver 200 would instead output a reception error (R_ERR)primitive. Once the transmitter 100 has received the R_OK primitive fromthe receiver 200, the transmitter 100 then outputs synchronizingprimitives (SYNC) 172, 174, followed by a CONT primitive 176 andscrambled data 178-188. The SYNC primitives are output when thetransmitter 100 is idle, and also serve the purpose of synchronizing thetransmitter 100 and the receiver 200. The receiver 200 will respond withSYNC primitives 280, 282, a CONT primitive 284, and scrambled data 286,288 of its own.

The above scenario is illustrative of sending a frame of payload datawithout any transmission problems. However, noise can interfere with thetransmission of primitives and data, which can cause communicationproblems between the transmitter 100 and the receiver 200. For instance,if the receiver 200 is not able to decode a SOF primitive sent from thetransmitter 100, the receiver 200 will continue to send out a R_RDYprimitive forever. However, the transmitter 100 will not know that thereceiver 200 did not receive the SOF primitive, and will still send outdata to the receiver 200 until the data transfer is complete, finishingby sending a WTRM primitive to the receiver 200. The receiver 200 willrespond to the WTRM primitive with a SYNC primitive because it neverreceived the SOF primitive at the beginning of the data transmission.Communication between the transmitter 100 and the receiver 200 may thenhang at this point because the receiver 200 does not send either an R_OKor R_ERR primitive to the transmitter 100.

Another potential problem will result if HOLD, HOLDA, CONT, or EOFprimitives are corrupted by noise. If these primitives are corrupted bynoise, it may result in the wrong data transfer length. If the CRC checkor 8-bit to 10-bit (8b10b) decoding are not able to identify thisproblem, then the problem may result in a system hang.

Additionally, if the HOLD, HOLDA, or CONT primitives are corrupted bynoise, the transmitter 100 may send out too much data and overflow thefirst-in first-out receiving queue of the receiver 200. Because noisecannot always be eliminated entirely, there must be a way of overcomingthe problems of corrupted primitives caused by noise.

SUMMARY

Methods for correcting corrupted primitives are provided. An exemplaryembodiment of a method of correcting corrupted primitives transmittedbetween a serial advanced technology attachment (SATA) host and a SATAdevice includes detecting the presence of a corrupted primitive;analyzing a current state, a previously transmitted primitive, or apreviously received primitive; selecting at least one candidateprimitive according to at least one of the current state, the previouslytransmitted primitive, and the previously received primitive; predictingthe identity of the corrupted primitive; and replacing the corruptedprimitive with the predicted primitive.

Another exemplary embodiment of a method of correcting corruptedprimitives transmitted between a SATA host and a SATA device includesdetecting the presence of a corrupted primitive; comparing byte contentand byte positions of the corrupted primitive with byte content and bytepositions of possible primitives; predicting the identity of thecorrupted primitive according to the comparison of the byte content andthe byte positions; and replacing the corrupted primitive with thepredicted primitive.

Another exemplary embodiment of a method of correcting corruptedprimitives transmitted between a SATA host and a SATA device includesdetecting the presence of a corrupted primitive; comparing portions ofthe corrupted primitive with portions of possible primitives; predictingthe identity of the corrupted primitive according to the comparison ofthe portion payload; and replacing the corrupted primitive with thepredicted primitive.

Another exemplary embodiment of a method of correcting corruptedprimitives transmitted between a SATA host and a SATA device includesdetecting the presence of a corrupted primitive; analyzing threeconsecutively received primitives; predicting the identity of thecorrupted primitive according to the three consecutively receivedprimitives; and replacing the corrupted primitive with the predictedprimitive.

Another exemplary embodiment of a method of detecting incorrectprimitives transmitted between a SATA host and a SATA device includesreceiving a first primitive; receiving a second primitive immediatelyfollowing reception of the first primitive; and detecting that thesecond primitive is an incorrect primitive when the second primitivecannot follow the first primitive during normal operation of the SATAhost and SATA device.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a table illustrating byte contents of primitives used in theSATA protocol.

FIG. 2 is a diagram showing an example of sending a frame between a hostand a device.

FIG. 3 is a functional block diagram of an exemplary embodimentprimitive prediction system.

FIG. 4 is a functional block diagram of another exemplary embodimentprimitive prediction system.

FIG. 5 is a functional block diagram of another exemplary embodimentprimitive prediction system.

FIG. 6 is a functional block diagram of yet another exemplary embodimentprimitive prediction system.

DETAILED DESCRIPTION

Since primitives sent between the transmitter 100 and the receiver 200can become corrupted by noise, it is useful to have a way of predictingwhat the original primitive was and then correcting the corruptedprimitive to become the predicted primitive. Several exemplaryembodiment methods are introduced for predicting the actual value of thecorrupted primitive, and these embodiments can also be used inconjunction with each other for ensuring higher accuracy of thepredictions. Each of the exemplary embodiment methods will be explainedbelow with reference to FIG. 1 and FIG. 2.

First of all, some primitives are only used during certain transmissionstates. For example, after the receiver 200 has sent an R_RDY primitiveto the transmitter 100, the receiver 200 will expect to receive an SOFprimitive to begin frame transmission. Therefore, the receiver 200 canbe restricted to predicting that a corrupted primitive is the SOFprimitive only when sending out the R_RDY primitive. Moreover, the HOLD,HOLDA, CONT, and EOF primitives will only be corrected during a datatransmission or data reception state. For example, the EOF primitivewill only be expected when the receiver 200 is in a R_IP state, a directmemory access terminate (DMAT) state, or a HOLDA state, or a HOLD state.In these states, the EOF primitive can be predicted if it is determinedto be the most likely value of the corrupted primitive. Similarly, theHOLD, HOLDA, and CONT primitives will only be expected when the receiver200 is in a R_IP state, a direct memory access terminate (DMAT) state, aHOLDA state, a HOLD state, or when the transmitter 100 is in a HOLDstate, HOLDA state or a data transmission state.

In addition to considering the current state of data transmission andreception, previously received primitives or later received primitivescan also be used for predicting the value of corrupted primitives.Three, four, or five consecutive primitives can also be analyzed fordetermining the identity of corrupted primitives, wherein the corruptedprimitive can be any one of the consecutive primitives being analyzed.

The CONT primitive especially benefits from these predictions due to theconditions under which it is used. As shown in FIG. 2, the CONTprimitive always follows two identical primitives, and is often followedby scrambled data. The CONT primitive is used instead of having the sameprimitive repeatedly transmitted, which could cause problems with EMI.Because of the special pattern in which the CONT primitive alwaysfollows two identical primitives, it is easier to make predictions. Thatis, if a corrupted primitive follows two identical primitives, it ispossible that the corrupted primitive is the CONT primitive. On theother hand, if a CONT primitive follows a pair of primitives, where oneof the primitives is corrupted and the other is non-corrupted, thecorrupted primitive can reliably be predicted to be identical to thenon-corrupted primitive.

As shown in FIG. 1, the contents of one or more bytes of corruptedprimitives can also be used to predict the actual identity of thecorrupted primitives. For example, when a third or a fourth byte of thecorrupted primitive has a content of D23.1, the identity of thecorrupted primitive is predicted to be a SOF primitive. Further checkingcan also be performed to ensure greater accuracy. That is, the contentof other bytes such as the second, third, and fourth bytes of thecorrupted primitive can also be checked to make sure that these bytes donot match the corresponding content of other possible primitives. Inaddition, fractions of the 32 or 40 bits of each corrupted primitive canalso be compared to the known bit values of primitives to predict theidentity of the corrupted primitive. A predetermined number of bits ofthe corrupted primitive can be compared with the predetermined number ofbits of the possible primitives. For example, if the 23 leastsignificant bits of the 40 bits of the corrupted primitive areconsistent with the 23 least significant bits of the CONT primitive,then the corrupted primitive is predicted to be the CONT primitive.

The EOF primitive can also be similarly predicted. When a first byte ofthe corrupted primitive has a content of K28.3, a second byte of thecorrupted primitive has a content of D21.5, and either a third byte or afourth byte has a content of D21.6, the identity of the corruptedprimitive is predicted to be an EOF primitive. Further checks can alsobe made to confirm that the content of both the third and fourth bytesof the corrupted primitive do not match the corresponding content ofother possible primitives.

When a first byte of the corrupted primitive has a content of K28.3, asecond byte of the corrupted primitive has a content of D10.5 and eithera third byte or a fourth byte has a content of D25.4, the identity ofthe corrupted primitive can be predicted to be a CONT primitive. Furtherchecks can be made to confirm that the content of the second, third, andfourth bytes of the corrupted primitive do not match the correspondingcontent of other possible primitives.

When a first byte of the corrupted primitive has a content of K28.3, asecond byte has a content of D10.5, and either a third byte or a fourthbyte has a content of D21.6, the identity of the corrupted primitive ispredicted to be a HOLD primitive. Further checks can also be made toconfirm that the content of the third and fourth bytes of the corruptedprimitive do not match the corresponding content of other possibleprimitives.

When a first byte of the corrupted primitive has a content of K28.3, asecond byte has a content of D10.5, and either a third byte or a fourthbyte has a content of D21.4, the identity of the corrupted primitive ispredicted to be a HOLDA primitive. Further checks can also be made toconfirm that the content of the third and fourth bytes of the corruptedprimitive do not match the corresponding content of other possibleprimitives.

Please refer to FIG. 3. FIG. 3 is a functional block diagram of anexemplary embodiment primitive prediction system 300. The system 300includes a primitive decode circuit 302 which receives a series ofprimitives as input. As each primitive is received by the primitivedecode circuit 302, it predicts the value of the primitive if theprimitive is corrupted and passes the primitive on to a delay circuit304. The delay circuit 304 adds a delay of one primitive period, andoutputs the previously received primitive to the primitive decodecircuit 302 as the primitive decode circuit 302 is receiving thefollowing primitive. Furthermore, the primitive decode circuit 302 readsinformation from a primitive code book 306 for determining the actualbit and byte values that the primitives should have. The primitivedecode circuit 302 uses information including one or more previouslyreceived primitives, the currently received primitive, and the values ofstandard primitives according to the primitive code book 306 to predictthe value of the corrupted primitive.

Please refer to FIG. 4. FIG. 4 is a functional block diagram of anotherexemplary embodiment primitive prediction system 320. The system 320includes a primitive decode circuit 322, a primitive code book 326, andcontrol logic 324. The primitive decode circuit 322 receives a series ofprimitives as input, predicts the values of the primitives and outputsthe predicted primitives. A copy of the predicted primitives is alsopassed to the control logic 324, which keeps track of the current stateof transmission and reception. The control logic 324 will output thecurrent state to the primitive decode circuit 322, which uses thisinformation together with information from the primitive code book 326to predict the values of corrupted primitives.

Please refer to FIG. 5. FIG. 5 is a functional block diagram of anotherexemplary embodiment primitive prediction system 340. The system 340 issimilar to the system 300 shown in FIG. 4, but has a slightly differentarrangement of a delay circuit 344. Received primitives are input toboth the delay circuit 344 and a primitive decode circuit 342. Theprimitive decode circuit 342 also receives previously receivedprimitives from the delay circuit 344. The primitive decode circuit 342uses the previously received primitive information together with thecurrent primitive value and information from a primitive code book 346to predict the values of corrupted primitives.

Please refer to FIG. 6. FIG. 6 is a functional block diagram of yetanother exemplary embodiment primitive prediction system 360. The system360 comprises a primitive decode circuit 362 and a primitive code book364. The primitive decode circuit 362 receives a current primitive andcompares the bits and bytes of the current primitives to standardprimitive values contained in the primitive code book 364. The currentprimitive is then predicted to be whichever standard primitive thecurrent primitive is closest to out of all of the candidate primitives.In order for the corrupted primitive to be closest in contents to aspecific candidate primitive as compared to the other candidateprimitives, the hamming distance between the corrupted primitive and thespecific candidate primitive is smallest as compared to the othercandidate primitives. The hamming distance is measured by performing anexclusive-OR (XOR) function on the candidate primitives and thecorrupted primitives bit by bit.

It should be noted that the prediction of the identity of corruptedprimitives is not limited to the SOF, HOLD, HOLDA, CONT, and EOFprimitives. Other primitives can also be predicted and corrected in thesame way that these five primitives are. However, the incorrectdetection of these five primitives can have the effect of stalling orhanging communication and data transmission between the transmitter 100and the receiver 200, so they are viewed as especially important. Forbest results, both state information and byte content comparisons areused to predict the identity of corrupted primitives. Once the identityof the corrupted primitive is determined, the corrupted primitive isthen replaced with the predicted primitive for elimination communicationproblems between the transmitter 100 and the receiver 200. The abovemethod is suitable for application to the serial advanced technologyattachment (SATA) specification or Serial-Attached SCSI (SAS)specification, along with any other similar communication standards.

In addition to predicting the identity of corrupted primitives,incorrect primitives can also be detected by analyzing both thepreviously received primitive and the currently received primitive thatimmediately follows the previously received primitive. For example, ifthe previously received primitive is a reception with no error (R_OK)primitive and the currently received primitive is a reception error(R_ERR) primitive, it can be deduced that the currently receivedprimitive is an incorrect primitive since the reception error (R_ERR)primitive cannot follow the reception with no error (R_OK) primitive.Likewise, if the previously received primitive is a transmission dataready (X_RDY) primitive and the currently received primitive is a waitfor frame termination (WTRM) primitive, it can be deduced that thecurrently received primitive is an incorrect primitive since the waitfor frame termination (WTRM) primitive cannot follow the transmissiondata ready (X_RDY) primitive. Therefore, even if the currently receivedprimitive is a valid primitive and adheres to the protocol of the serialadvanced technology attachment (SATA) specification, incorrectprimitives can still be detected.

Those skilled in the art will readily observe that numerousmodifications and alterations of the device and method may be made whileretaining the teachings of the invention. Accordingly, the abovedisclosure should be construed as limited only by the metes and boundsof the appended claims.

1. A method of correcting corrupted primitives transmitted between aserial advanced technology attachment (SATA) host and a SATA device, themethod comprising: detecting the presence of a corrupted primitive;analyzing a current state, a previously transmitted primitive, or apreviously received primitive; selecting at least one candidateprimitive according to at least one of the current state, the previouslytransmitted primitive and the previously received primitive; predictingthe identity of the corrupted primitive according to at least onecandidate primitive and the corrupted primitive; and replacing thecorrupted primitive with the predicted primitive.
 2. The method of claim1, wherein when at least one byte of the corrupted primitive has thesame content as a corresponding byte of a specific candidate primitiveX, the identity of the corrupted primitive is predicted to be primitiveX.
 3. The method of claim 1, wherein when M bytes of N bytes of thecorrupted primitive have the same content as corresponding bytes of aspecific candidate primitive X, the identity of the corrupted primitiveis predicted to be primitive X.
 4. The method of claim 3, wherein M andN are integers and M is smaller than N.
 5. The method of claim 3,wherein M is one of 1, 2, and 3 and N is
 4. 6. The method of claim 1,wherein when fractions of the corrupted primitive have the same contentas a specific candidate primitive X, the identity of the corruptedprimitive is predicted to be primitive X.
 7. The method of claim 1,wherein when the corrupted primitive is closest in contents to aspecific candidate primitive X as compared to the other candidateprimitives, the identity of the corrupted primitive is predicted to beprimitive X.
 8. The method of claim 7, wherein when the corruptedprimitive is closest in contents to a specific candidate primitive X ascompared to the other candidate primitives, the hamming distance betweenthe corrupted primitive and the specific candidate primitive X issmallest as compared to the other candidate primitives.
 9. The method ofclaim 8, wherein the hamming distance is measured by performingexclusive-OR function bit by bit.
 10. The method of claim 1, wherein theprimitive has 40 bits or 32 bits.
 11. The method of claim 2, wherein thecandidate primitives are selected from the group consisting of SOF, EOF,CONT, HOLD, and HOLDA.
 12. The method of claim 2, wherein the candidateprimitives are primitives used in the serial advanced technologyattachment (SATA) specification or Serial-Attached SCSI (SAS)specification.
 13. The method of claim 1, wherein when the current stateis a receiver ready state, a third byte of the corrupted primitive has acontent of D23.1 or a fourth byte of the corrupted primitive has acontent of D23.1, and the previously transmitted primitive as a R_RDYprimitive, the identity of the corrupted primitive is predicted to be astart of frame (SOF) primitive.
 14. The method of claim 1, wherein whenanalyzing that the previously received primitive was a transmission dataready (X_RDY) primitive and a third byte of the corrupted primitive hasa content of D23.1 or a fourth byte of the corrupted primitive has acontent of D23.1, the identity of the corrupted primitive is predictedto be a start of frame (SOF) primitive.
 15. The method of claim 1,wherein when the current state of data reception indicates a receptionin progress (R_IP) state, direct memory access terminate (DMAT) state,hold data transmission (HOLD) state, or hold acknowledge (HOLDA) state,and a first byte of the corrupted primitive has a content of K28.3, asecond byte of the corrupted primitive has a content of D21.5, andeither a third byte or a fourth byte has a content of D21.6, theidentity of the corrupted primitive is predicted to be an end of frame(EOF) primitive.
 16. The method of claim 1, further comprisingdetermining that the previously received payload was data, and a firstbyte of the corrupted primitive has a content of K28.3, a second byte ofthe corrupted primitive has a content of D21.5 to predict EOF.
 17. Themethod of claim 1, wherein when the current state of data transmissionor data reception indicates a reception in progress (R_IP) state, directmemory access terminate (DMAT) state, hold data transmission (HOLD)state, hold acknowledge (HOLDA) state, or data transmission state, and afirst byte of the corrupted primitive has a content of K28.3 and eithera third byte or a fourth byte has a content of D25.4, the identity ofthe corrupted primitive is predicted to be a continue repeating previousprimitive (CONT) primitive.
 18. The method of claim 1, wherein analyzingthe current state of data reception further comprises determining thatthe two previously received primitives were identical primitives and afirst byte of the corrupted primitive has a content of K28.3 and eithera third byte or a fourth byte has a content of D25.4 to predict CONT.19. The method of claim 1, further comprising determining that a firstbyte of the corrupted primitive has a content of K28.3 and either athird byte or a fourth byte has a content of D25.4 to predict CONT. 20.The method of claim 1, wherein when the current state of datatransmission or data reception indicates a reception in progress (R_IP)state, direct memory access terminate (DMAT) state, hold datatransmission (HOLD) state, hold acknowledge (HOLDA) state, or datatransmission state, and a first byte of the corrupted primitive has acontent of K28.3 a second byte has a content of D10.5, and either athird byte or a fourth byte has a content of D21.6, the identity of thecorrupted primitive is predicted to be a HOLD primitive.
 21. The methodof claim 1, further comprising determining that the previously receivedprimitive was a HOLD primitive, and a first byte of the corruptedprimitive has a content of K28.3 and either a third byte or a fourthbyte has a content of D21.6.
 22. The method of claim 1, wherein when thecurrent state of data transmission or data reception indicates areception in progress (R_IP) state, direct memory access terminate(DMAT) state, hold data transmission (HOLD) state, hold acknowledge(HOLDA) state, or data transmission state, and a first byte of thecorrupted primitive has a content of K28.3, a second byte has a contentof D10.5, and either a third byte or a fourth byte has a content ofD21.4, the identity of the corrupted primitive is predicted to be aHOLDA primitive.
 23. The method of claim 1, further comprisingdetermining that the previously received primitive was a HOLDAprimitive, and a first byte has a content of K28.3, and either a thirdbyte or a fourth byte has a content of D21.4.
 24. The method of claim 1,wherein when the current state of data transmission or data receptionindicates that a corrupted primitive is received in one of the twoprimitives preceding a continue repeating previous primitive (CONT)primitive, the corrupted primitive is predicted to be equal to the otherof the two primitives that is not corrupted.
 25. A method of correctingcorrupted primitives transmitted between a serial advanced technologyattachment (SATA) host and a SATA device, the method comprising:detecting the presence of a corrupted primitive; comparing byte contentand byte positions of the corrupted primitive with byte content and bytepositions of possible primitives; predicting the identity of thecorrupted primitive according to the comparison of the byte content andthe byte positions; and replacing the corrupted primitive with thepredicted primitive.
 26. The method of claim 25, wherein the possibleprimitives are primitives used in the serial advanced technologyattachment (SATA) specification or Serial-Attached SCSI (SAS)specification.
 27. The method of claim 25, wherein the byte content isstored using 10 bits or 8 bits.
 28. The method of claim 25, wherein whena first byte of the corrupted primitive has a content of K28.3, a thirdbyte of the corrupted primitive has a content of D23.1 or a fourth byteof the corrupted primitive has a content of D23.1, and content of thesecond, third, and fourth bytes of the corrupted primitive does notmatch the corresponding content of other possible primitives, theidentity of the corrupted primitive is predicted to be a start of frame(SOF) primitive.
 29. The method of claim 25, wherein when a first byteof the corrupted primitive has a content of K28.3, a second byte of thecorrupted primitive has a content of D21.5, and either a third byte or afourth byte has a content of D21.6, and content of third and fourthbytes of the corrupted primitive does not match the correspondingcontent of other possible primitives, the identity of the corruptedprimitive is predicted to be an end of frame (EOF) primitive.
 30. Themethod of claim 25, wherein when a first byte of the corrupted primitivehas a content of K28.3 and either a third byte or a fourth byte has acontent of D25.4, and content of the second, third, and fourth bytes ofthe corrupted primitive does not match the corresponding content ofother possible primitives, the identity of the corrupted primitive ispredicted to be a continue repeating previous primitive (CONT)primitive.
 31. The method of claim 25, wherein when a first byte of thecorrupted primitive has a content of K28.3 and a second byte of thecorrupted primitive has a content of D10.5, either a third byte or afourth byte has a content of D25.4, the identity of the corruptedprimitive is predicted to be a continue repeating previous primitive(CONT) primitive, wherein the content of the third, and fourth bytes ofthe corrupted primitive do not match the corresponding content of otherpossible primitives.
 32. The method of claim 25, wherein when a firstbyte of the corrupted primitive has a content of K28.3, second byte hasa content of D10.5, and either a third byte or a fourth byte has acontent of D21.6, and content of the third and fourth bytes of thecorrupted primitive does not match the corresponding content of otherpossible primitives, the identity of the corrupted primitive ispredicted to be a hold data transmission (HOLD) primitive.
 33. Themethod of claim 25, wherein when a first byte of the corrupted primitivehas a content of K28.3, second byte has a content of D10.5 and either athird byte or a fourth byte has a content of D21.4, and content of thethird and fourth bytes of the corrupted primitive does not match thecorresponding content of other possible primitives, the identity of thecorrupted primitive is predicted to be a hold acknowledge (HOLDA)primitive.
 34. A method of correcting corrupted primitives transmittedbetween a serial advanced technology attachment (SATA) host and a SATAdevice, the method comprising: detecting the presence of a corruptedprimitive; comparing portions of the corrupted primitive with portionsof possible primitives; predicting the identity of the corruptedprimitive according to the comparison of the portion payload; andreplacing the corrupted primitive with the predicted primitive.
 35. Themethod of claim 34, wherein the step of comparing is implemented bycomparing a predetermined number of bits of the corrupted primitive withthe predetermined number of bits of the possible primitives.
 36. Amethod of correcting corrupted primitives transmitted between a serialadvanced technology attachment (SATA) host and a SATA device, the methodcomprising: detecting the presence of a corrupted primitive; analyzingthree consecutively received primitives; predicting the identity of thecorrupted primitive according to the three consecutively receivedprimitives; and replacing the corrupted primitive with the predictedprimitive.
 37. The method of claim 36, wherein the corrupted primitiveis selected from a group of the three consecutively received primitives.38. The method of claim 37, further comprising analyzing four or fiveconsecutively received primitives.
 39. A method of detecting incorrectprimitives transmitted between a serial advanced technology attachment(SATA) host and a SATA device, the method comprising: receiving a firstprimitive; receiving a second primitive immediately following receptionof the first primitive; and detecting that the second primitive is anincorrect primitive when the second primitive cannot follow the firstprimitive during normal operation of the SATA host and SATA device. 40.The method of claim 39, wherein the first primitive is a reception withno error (R_OK) primitive and the second primitive is a reception error(R_ERR) primitive.
 41. The method of claim 39, wherein the firstprimitive is a transmission data ready (X_RDY) primitive and the secondprimitive is a wait for frame termination (WTRM) primitive.